import { createApp } from "vue";
import { createPinia } from "pinia";
import App from "./App.vue";

import ElementPlus from "element-plus";
import "element-plus/theme-chalk/index.css";
import "element-plus/theme-chalk/dark/css-vars.css";

import router from "./router/";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import permission from "./directive/permission/permission";

import DeleteModal from './components/Alter/DeleteModal.vue'

const pinia = createPinia();
const app = createApp(App);

app.directive("has", permission.checkPermission);

// 引入图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.component('DeleteModal',DeleteModal)

app.use(ElementPlus);
app.use(router);
app.use(pinia);
app.mount("#app");
